#include "method/filler.h"

#include "model/matrixtransformation.h"
#include "model/scene.h"

#include <QWidget>

void Filler::window2viewport(QWidget *container, Scene *scene) {

    MatrixTransformation t;
    //    t.translation( -ground->lower.x, -ground->lower.y );
    //    t.scale( ((coord)container->width())/ground->width(), ((coord)container->height())/ground->height() );
    t.scale( 1, -1, -1 );
    t.translation( container->width()/2, container->height()/2 );

    for ( Object *ground: scene->getObjects()) {
        ground->apply(t);
    }
}

